package com.hwh.service.emp.impl;

import java.util.List;

import com.hwh.DAO.emp.DepartmentDAO;
import com.hwh.model.emp.Department;
import com.hwh.service.emp.DepartmentService;

public class DepartmentServiceImpl implements DepartmentService {

	private DepartmentDAO departmentDAO;
	public DepartmentDAO getDepartmentDAO() {
		return departmentDAO;
	}

	public void setDepartmentDAO(DepartmentDAO departmentDAO) {
		this.departmentDAO = departmentDAO;
	}

	public void addDepartment(Department department) {
		departmentDAO.save(department);
	}

	public void deleteDepartment(String id) {
		departmentDAO.delete(departmentDAO.findById(id));
	}

	public void updataDepartment(Department department) {
		departmentDAO.save(department);

	}

	public List findDepartment(String propertyName, Object value) {
		return departmentDAO.findByProperty(propertyName, value);
	}

	public List findAllDepartments() {
		// TODO Auto-generated method stub
		return departmentDAO.findAll();
	}

	public List findByPage(int currentPage, int pageSize) {
		// TODO Auto-generated method stub
		
		return departmentDAO.findByPage(currentPage, pageSize);
	}

}
